<template>
  <div>
    <p>发起人</p>
    <div>张三</div>
    <p v-if="processType && processType === 'payrollCredit'">发起人是否可见明细金额</p>
    <div v-if="processType && processType === 'payrollCredit'">
      <el-radio-group v-model="isShow">
        <el-radio label="1">可见</el-radio>
        <el-radio label="0">不可见</el-radio>
      </el-radio-group>
    </div>
    <div>
      <el-button @click="cancelFn">取消</el-button>
      <el-button type="primary" @click="confirmFn">确定</el-button>
    </div>
  </div>
</template>

<script>
import { mapState } from "vuex";
export default {
  name: "RootConfig",
  props: {
    config: {
      type: Object,
      default: () => {
        return {};
      },
    },
  },
  data() {
    return {
      isShow: null
    };
  },
  computed: {
    ...mapState(['processType']),
    nodeProps() {
      return this.$store.state.selectedNode.props;
    },
    select() {
      return this.config.assignedUser;
    },
  },
  created() {
    this.isShow = this.nodeProps.isShow;
  },
  methods: {
    confirmFn() {
      this.$set(this.$store.state.selectedNode.props, 'isShow', this.isShow);
      this.$emit('cancel');
    },
    cancelFn() {
      this.$emit('cancel');
    }
  },
};
</script>

<style lang="less" scoped>
.desc {
  font-size: small;
  color: #8c8c8c;
}
.org-item {
  margin: 5px;
}
</style>
